package com.xinbochuang.machine.admin.mapper.macRoom;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinbochuang.machine.admin.domain.macRoom.EquCabinet;
import com.xinbochuang.machine.admin.domain.macRoom.MacRoom;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @author 杜文博
 * @date 2020-09-08
 */
public interface MacRoomMapper extends BaseMapper<MacRoom> {

	/**
	 * 查询机房详情
	 * @param macName
	 * @return
	 */
	List<MacRoom> findMacRoom(String macName);

	/**
	 * 根据macId 删除机房下所有机柜(逻辑删除)
	 */

	Boolean deleteCabinetByMacId(String macId);

	/**
	 * 根据macId 删除机房下所有机柜
	 */
	int deleteEquCabinetByMacId (String macId);

	/**
	 * 根据macId 查询机房下所有机柜
	 */
	List<EquCabinet> getEquCabinetByMacId (String macId);

	/**
	 * 根据cabinetId 删除 机柜下所有数据
	 */
	int deleteEquipmentByCabinetId (String cabinetId);

    IPage<MacRoom> getMacRoomList(Page<MacRoom> page, @Param("macRoom") MacRoom macRoom, @Param("deptIds") List<Integer> deptIds);

	/**
	 * 机房远程搜索
	 */
	List<MacRoom> selectMacRoom(String macName);
}
